<template>
  <div class="ta-right">{{ showText }}</div>
</template>

<script setup>
import { DEFAULT_TEXT } from '@/utils/const';
const props = defineProps({
  money: {
    type: [Number, String],
    default: null
  }
});

const showText = computed(() => {
  const _money = props.money;
  if (_money == null || _money === '' || isNaN(Number(_money))) {
    return DEFAULT_TEXT;
  }
  let val = Number(_money).toFixed(2);
  return val.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
});
</script>

<style lang="scss" scoped></style>
